package com.banmoon.mediator;

public class MediatorMain {

    public static void main(String[] args) {
        ConcreteMediator mediator = new ConcreteMediator();
        GoodLandlord goodLandlord = new GoodLandlord("李四", mediator,
                new House(3, 500, true, 1800),
                new House(6, 500, true, 2000));
        BadLandlord badLandlord = new BadLandlord("李四", mediator,
                new House(3, 800, false, 2000),
                new House(6, 800, true, 2200));

        goodLandlord.sendMessage();
        badLandlord.sendMessage();

        System.out.println("============== 分割线 ==============");
        // 找一个距离地铁500米内，三楼，有阳台，且租金要少于2000元的租房
        House house = mediator.findHouse(3, 500, true, 2000);
        if(house!=null){
            System.out.println("找到了");
            house.showInfo();
        }else
            System.out.println("可惜没有找到");
    }
}
